<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD><TITLE>Tk_ConfigureWindow manual page - Tk Library Procedures</TITLE>
<link rel="stylesheet" href="../docs.css" type="text/css" media="all">
</HEAD>
<BODY><H2><a href="../contents.htm">Tcl8.6.11/Tk8.6.11 Documentation</a> <small>&gt;</small> <a href="contents.htm">Tk C API</a> <small>&gt;</small> ConfigWind</H2>
<H3><A HREF="../UserCmd/contents.htm">Tcl/Tk Applications</A> | <A HREF="../TclCmd/contents.htm">Tcl Commands</A> | <A HREF="../TkCmd/contents.htm">Tk Commands</A> | <A HREF="../ItclCmd/contents.htm">[incr Tcl] Package Commands</A> | <A HREF="../SqliteCmd/contents.htm">SQLite3 Package Commands</A> | <A HREF="../TdbcCmd/contents.htm">TDBC Package Commands</A> | <A HREF="../TdbcmysqlCmd/contents.htm">tdbc::mysql Package Commands</A> | <A HREF="../TdbcodbcCmd/contents.htm">tdbc::odbc Package Commands</A> | <A HREF="../TdbcpostgresCmd/contents.htm">tdbc::postgres Package Commands</A> | <A HREF="../TdbcsqliteCmd/contents.htm">tdbc::sqlite3 Package Commands</A> | <A HREF="../ThreadCmd/contents.htm">Thread Package Commands</A> | <A HREF="../TclLib/contents.htm">Tcl C API</A> | <A HREF="../TkLib/contents.htm">Tk C API</A> | <A HREF="../ItclLib/contents.htm">[incr Tcl] Package C API</A> | <A HREF="../TdbcLib/contents.htm">TDBC Package C API</A></H3>
<DL>
<DD><A HREF="ConfigWind.htm#M2" NAME="L87">NAME</A>
<DL><DD>Tk_ConfigureWindow, Tk_MoveWindow, Tk_ResizeWindow, Tk_MoveResizeWindow, Tk_SetWindowBorderWidth, Tk_ChangeWindowAttributes, Tk_SetWindowBackground, Tk_SetWindowBackgroundPixmap, Tk_SetWindowBorder, Tk_SetWindowBorderPixmap, Tk_SetWindowColormap, Tk_DefineCursor, Tk_UndefineCursor &mdash; change window configuration or attributes</DD></DL>
<DD><A HREF="ConfigWind.htm#M3" NAME="L88">SYNOPSIS</A>
<DL>
<DD><B>#include &lt;tk.h&gt;</B>
<DD><B>Tk_ConfigureWindow</B>(<I>tkwin, valueMask, valuePtr</I>)
<DD><B>Tk_MoveWindow</B>(<I>tkwin, x, y</I>)
<DD><B>Tk_ResizeWindow</B>(<I>tkwin, width, height</I>)
<DD><B>Tk_MoveResizeWindow</B>(<I>tkwin, x,  y, width, height</I>)
<DD><B>Tk_SetWindowBorderWidth</B>(<I>tkwin, borderWidth</I>)
<DD><B>Tk_ChangeWindowAttributes</B>(<I>tkwin, valueMask, attsPtr</I>)
<DD><B>Tk_SetWindowBackground</B>(<I>tkwin, pixel</I>)
<DD><B>Tk_SetWindowBackgroundPixmap</B>(<I>tkwin, pixmap</I>)
<DD><B>Tk_SetWindowBorder</B>(<I>tkwin, pixel</I>)
<DD><B>Tk_SetWindowBorderPixmap</B>(<I>tkwin, pixmap</I>)
<DD><B>Tk_SetWindowColormap</B>(<I>tkwin, colormap</I>)
<DD><B>Tk_DefineCursor</B>(<I>tkwin, cursor</I>)
<DD><B>Tk_UndefineCursor</B>(<I>tkwin</I>)
</DL>
<DD><A HREF="ConfigWind.htm#M4" NAME="L89">ARGUMENTS</A>
<DL class="arguments">
</DL>
<DD><A HREF="ConfigWind.htm#M5" NAME="L90">DESCRIPTION</A>
<DD><A HREF="ConfigWind.htm#M6" NAME="L91">BUGS</A>
<DD><A HREF="ConfigWind.htm#M7" NAME="L92">SEE ALSO</A>
<DD><A HREF="ConfigWind.htm#M8" NAME="L93">KEYWORDS</A>
</DL>
<H3><A NAME="M2">NAME</A></H3>
Tk_ConfigureWindow, Tk_MoveWindow, Tk_ResizeWindow, Tk_MoveResizeWindow, Tk_SetWindowBorderWidth, Tk_ChangeWindowAttributes, Tk_SetWindowBackground, Tk_SetWindowBackgroundPixmap, Tk_SetWindowBorder, Tk_SetWindowBorderPixmap, Tk_SetWindowColormap, Tk_DefineCursor, Tk_UndefineCursor &mdash; change window configuration or attributes
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>#include &lt;tk.h&gt;</B><BR>
<B>Tk_ConfigureWindow</B>(<I>tkwin, valueMask, valuePtr</I>)<BR>
<B>Tk_MoveWindow</B>(<I>tkwin, x, y</I>)<BR>
<B>Tk_ResizeWindow</B>(<I>tkwin, width, height</I>)<BR>
<B>Tk_MoveResizeWindow</B>(<I>tkwin, x,  y, width, height</I>)<BR>
<B>Tk_SetWindowBorderWidth</B>(<I>tkwin, borderWidth</I>)<BR>
<B>Tk_ChangeWindowAttributes</B>(<I>tkwin, valueMask, attsPtr</I>)<BR>
<B>Tk_SetWindowBackground</B>(<I>tkwin, pixel</I>)<BR>
<B>Tk_SetWindowBackgroundPixmap</B>(<I>tkwin, pixmap</I>)<BR>
<B>Tk_SetWindowBorder</B>(<I>tkwin, pixel</I>)<BR>
<B>Tk_SetWindowBorderPixmap</B>(<I>tkwin, pixmap</I>)<BR>
<B>Tk_SetWindowColormap</B>(<I>tkwin, colormap</I>)<BR>
<B>Tk_DefineCursor</B>(<I>tkwin, cursor</I>)<BR>
<B>Tk_UndefineCursor</B>(<I>tkwin</I>)<BR>
<H3><A NAME="M4">ARGUMENTS</A></H3>
<DL class="arguments">
<DT><A HREF="../TkLib/WindowId.htm">Tk_Window</A> <B>tkwin</B> (in)<DD>
Token for window.
<P><DT>unsigned int <B>valueMask</B> (in)<DD>
OR-ed mask of values like <B>CWX</B> or <B>CWBorderPixel</B>,
indicating which fields of <I>*valuePtr</I> or <I>*attsPtr</I> to use.
<P><DT>XWindowChanges <B>*valuePtr</B> (in)<DD>
Points to a structure containing new values for the configuration
parameters selected by <I>valueMask</I>.  Fields not selected
by <I>valueMask</I> are ignored.
<P><DT>int <B>x</B> (in)<DD>
New x-coordinate for <I>tkwin</I>'s top left pixel (including
border, if any) within tkwin's parent.
<P><DT>int <B>y</B> (in)<DD>
New y-coordinate for <I>tkwin</I>'s top left pixel (including
border, if any) within tkwin's parent.
<P><DT>int <B>width</B> (in)<DD>
New width for <I>tkwin</I> (interior, not including border).
<P><DT>int <B>height</B> (in)<DD>
New height for <I>tkwin</I> (interior, not including border).
<P><DT>int <B>borderWidth</B> (in)<DD>
New width for <I>tkwin</I>'s border.
<P><DT>XSetWindowAttributes <B>*attsPtr</B> (in)<DD>
Points to a structure containing new values for the attributes
given by the <I>valueMask</I> argument.  Attributes not selected
by <I>valueMask</I> are ignored.
<P><DT>unsigned long <B>pixel</B> (in)<DD>
New background or border color for window.
<P><DT>Pixmap <B>pixmap</B> (in)<DD>
New pixmap to use for background or border of <I>tkwin</I>.  WARNING:
cannot necessarily be deleted immediately, as for Xlib calls.  See
note below.
<P><DT>Colormap <B>colormap</B> (in)<DD>
New colormap to use for <I>tkwin</I>.
<P><DT><A HREF="../TkLib/GetCursor.htm">Tk_Cursor</A> <B>cursor</B> (in)<DD>
New cursor to use for <I>tkwin</I>.  If <B>None</B> is specified, then
<I>tkwin</I> will not have its own cursor;  it will use the cursor
of its parent.
<P></DL>
<H3><A NAME="M5">DESCRIPTION</A></H3>
These procedures are analogous to the X library procedures
with similar names, such as <B>XConfigureWindow</B>.  Each
one of the above procedures calls the corresponding X procedure
and also saves the configuration information in Tk's local
structure for the window.  This allows the information to
be retrieved quickly by the application (using macros such
as <B><A HREF="../TkLib/WindowId.htm">Tk_X</A></B> and <B><A HREF="../TkLib/WindowId.htm">Tk_Height</A></B>) without having to contact
the X server.  In addition, if no X window has actually been
created for <I>tkwin</I> yet, these procedures do not issue
X operations or cause event handlers to be invoked;  they save
the information in Tk's local
structure for the window;  when the window is created later,
the saved information will be used to configure the window.
<P>
See the X library documentation for details on what these
procedures do and how they use their arguments.
<P>
In the procedures <B>Tk_ConfigureWindow</B>, <B>Tk_MoveWindow</B>,
<B>Tk_ResizeWindow</B>, <B>Tk_MoveResizeWindow</B>, and
<B>Tk_SetWindowBorderWidth</B>,
if <I>tkwin</I> is an internal window then event handlers interested
in configure events are invoked immediately, before the procedure
returns.  If <I>tkwin</I> is a top-level window
then the event handlers will be invoked later, after X has seen
the request and returned an event for it.
<P>
Applications using Tk should never call procedures like
<B>XConfigureWindow</B> directly;  they should always use the
corresponding Tk procedures.
<P>
The size and location of a window should only be modified by the
appropriate geometry manager for that window and never by a window
itself (but see <B><A HREF="../TkLib/MoveToplev.htm">Tk_MoveToplevelWindow</A></B> for moving a top-level
window).
<P>
You may not use <B>Tk_ConfigureWindow</B> to change the
stacking order of a window (<I>valueMask</I> may not contain the
<B>CWSibling</B> or <B>CWStackMode</B> bits).
To change the stacking order, use the procedure <B><A HREF="../TkLib/Restack.htm">Tk_RestackWindow</A></B>.
<P>
The procedure <B>Tk_SetWindowColormap</B> will automatically add
<I>tkwin</I> to the <B>TK_COLORMAP_WINDOWS</B> property of its
nearest top-level ancestor if the new colormap is different from
that of <I>tkwin</I>'s parent and <I>tkwin</I> is not already in
the <B>TK_COLORMAP_WINDOWS</B> property.
<H3><A NAME="M6">BUGS</A></H3>
<B>Tk_SetWindowBackgroundPixmap</B> and <B>Tk_SetWindowBorderPixmap</B>
differ slightly from their Xlib counterparts in that the <I>pixmap</I>
argument may not necessarily be deleted immediately after calling
one of these procedures.  This is because <I>tkwin</I>'s window
may not exist yet at the time of the call, in which case <I>pixmap</I>
is merely saved and used later when <I>tkwin</I>'s window is actually
created.  If you wish to delete <I>pixmap</I>, then call
<B><A HREF="../TkLib/CrtWindow.htm">Tk_MakeWindowExist</A></B> first to be sure that <I>tkwin</I>'s window exists
and <I>pixmap</I> has been passed to the X server.
<P>
A similar problem occurs for the <I>cursor</I> argument passed to
<B>Tk_DefineCursor</B>.  The solution is the same as for pixmaps above:
call <B><A HREF="../TkLib/CrtWindow.htm">Tk_MakeWindowExist</A></B> before freeing the cursor.
<H3><A NAME="M7">SEE ALSO</A></H3>
<B><A HREF="../TkLib/MoveToplev.htm">Tk_MoveToplevelWindow</A></B>, <B><A HREF="../TkLib/Restack.htm">Tk_RestackWindow</A></B>
<H3><A NAME="M8">KEYWORDS</A></H3>
<A href="../Keywords/A.htm#attributes">attributes</A>, <A href="../Keywords/B.htm#border">border</A>, <A href="../Keywords/C.htm#color">color</A>, <A href="../Keywords/C.htm#configure">configure</A>, <A href="../Keywords/H.htm#height">height</A>, <A href="../Keywords/P.htm#pixel">pixel</A>, <A href="../Keywords/P.htm#pixmap">pixmap</A>, <A href="../Keywords/W.htm#width">width</A>, <A href="../Keywords/W.htm#window">window</A>, <A href="../Keywords/X.htm#x">x</A>, <A href="../Keywords/Y.htm#y">y</A>
<div class="copy">Copyright &copy; 1990-1993 The Regents of the University of California.
<BR>Copyright &copy; 1994-1996 Sun Microsystems, Inc.
</div>
</BODY></HTML>
